﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.SqlClient;

namespace xiaolanshu
{
    public partial class 护肤_精华 : Form
    {
        public SqlConnection conn;
        public 护肤_精华()
        {
            InitializeComponent();
            //string cstr = @"server=.\SqlExpress;database=小兰书;integrated security=SSPI";
            //conn = new SqlConnection(cstr);
            conn = SQLTools.conn;
        }
        private void pictureBox4_Click(object sender, EventArgs e)
        {
            
        }

        private void pictureBox5_Click(object sender, EventArgs e)
        {
            
        }

        private void pictureBox4_Click_1(object sender, EventArgs e)
        {
            string sql = "select 商品名称,价格,品类,适用肤质 ,功效 ,产地 ,净含量 ,保质期 from 护肤 where 价格=1080";
            SqlCommand cmd = new SqlCommand(sql, conn);
            conn.Open();
            SqlDataReader rd = cmd.ExecuteReader();
            while (rd.Read())
            {
                MessageBox.Show("商品名称：" + rd[0].ToString() + "\n" + "价格：" + rd[1].ToString() + "元\n" + "品类：" + rd[2].ToString() + "\n" + "适用肤质：" + rd[3].ToString() + "\n" + "功效：" + rd[4].ToString() + "\n" + "产地：" + rd[5].ToString() + "\n" + "净含量：" + rd[6].ToString() + "\n" + "保质期：" + rd[7].ToString());
            }
            rd.Close();
            conn.Close();
        }

        private void pictureBox5_Click_1(object sender, EventArgs e)
        {
            string sql = "select 商品名称,价格,品类,适用肤质 ,功效 ,产地 ,净含量 ,保质期 from 护肤 where 价格=690";
            SqlCommand cmd = new SqlCommand(sql, conn);
            conn.Open();
            SqlDataReader rd = cmd.ExecuteReader();
            while (rd.Read())
            {
                MessageBox.Show("商品名称：" + rd[0].ToString() + "\n" + "价格：" + rd[1].ToString() + "元\n" + "品类：" + rd[2].ToString() + "\n" + "适用肤质：" + rd[3].ToString() + "\n" + "功效：" + rd[4].ToString() + "\n" + "产地：" + rd[5].ToString() + "\n" + "净含量：" + rd[6].ToString() + "\n" + "保质期：" + rd[7].ToString());
            }
            rd.Close();
            conn.Close();
        }
    }
}
